home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / tape / tape.h < prev    next >
Encoding:
Text File  |  1992-08-10  |  14.5 KB  |  407 lines

  1.  
  2. int  Inquiry();
  3. void moveMedium();
  4. void modeSel();
  5. void pos();
  6. void prevRem();
  7. void sendCmd();
  8.  
  9. typedef struct PositionRobotCommand {
  10. #if BYTE_ORDER == BIG_ENDIAN
  11.     unsigned char command;
  12.     unsigned char unitNumber        :3;
  13.     unsigned char reserved        :5;
  14.     unsigned char transpElemAddr[2];
  15.     unsigned char destAddr[2];
  16.     unsigned char reserved2[2];
  17.     unsigned char reserved3        :7;
  18.     unsigned char invert        :1;
  19.     unsigned char reserved4;
  20. #else /* BYTE_ORDER == LITTLE_ENDIAN */
  21.     unsigned char command;
  22.     unsigned char reserved        :5;
  23.     unsigned char unitNumber        :3;
  24.     unsigned char transpElemAddr[2];
  25.     unsigned char destAddr[2];
  26.     unsigned char reserved2[2];
  27.     unsigned char invert        :1;
  28.     unsigned char reserved3        :7;
  29.     unsigned char reserved4;
  30. #endif
  31. } PositionRobotCommand;
  32.  
  33.  
  34. typedef struct PreventRemovalCommand {
  35. #if BYTE_ORDER == BIG_ENDIAN
  36.     unsigned char command;
  37.     unsigned char unitNumber        :3;
  38.     unsigned char reserved        :5;
  39.     unsigned char reserved2[2];
  40.     unsigned char reserved3        :7;
  41.     unsigned char prevent        :1;
  42.     unsigned char reserved4;
  43. #else /* BYTE_ORDER == LITTLE_ENDIAN */
  44.     unsigned char command;
  45.     unsigned char reserved        :5;
  46.     unsigned char unitNumber        :3;
  47.     unsigned char reserved2[2];
  48.     unsigned char prevent        :1;
  49.     unsigned char reserved3        :7;
  50.     unsigned char reserved4;
  51. #endif
  52. } PreventRemovalCommand;
  53.  
  54. typedef struct MoveMediumCommand {
  55. #if BYTE_ORDER == BIG_ENDIAN
  56.     unsigned char command;
  57.     unsigned char unitNumber    :3;
  58.     unsigned char reserved    :5;
  59.     unsigned char transpElemAddr[2];
  60.     unsigned char sourceAddr[2];
  61.     unsigned char destAddr[2];
  62.     unsigned char reserved2[2];
  63.     unsigned char reserved3    :7;
  64.     unsigned char invert    :1;
  65.     unsigned char eePos        :2;
  66.     unsigned char reserved4    :4;
  67.     unsigned char finalBits    :2;     /* These are fixed at 0. */
  68. #else /* BYTE_ORDER == LITTLE_ENDIAN */
  69.     unsigned char command;
  70.     unsigned char reserved    :5;
  71.     unsigned char unitNumber    :3;
  72.     unsigned char transpElemAddr[2];
  73.     unsigned char sourceAddr[2];
  74.     unsigned char destAddr[2];
  75.     unsigned char reserved2[2];
  76.     unsigned char invert    :1;
  77.     unsigned char reserved3    :7;
  78.     unsigned char finalBits    :2;    /* These are fixed at 0. */
  79.     unsigned char reserved4    :4;
  80.     unsigned char eePos        :2;
  81. #endif
  82. } MoveMediumCommand;
  83.  
  84.  
  85. typedef struct ModeSelectCommand {
  86. #if BYTE_ORDER == BIG_ENDIAN
  87.     unsigned char command;        /* 0x15, for Mode Select */
  88.     unsigned char unitNumber    :3;    /* Logical Unit Number to which
  89.                      * to pass the command. */
  90.     unsigned char pageFormat    :1;    /* 1 == SCSI-2;
  91.                      * Must be 1 for Exabyte robot. */
  92.     unsigned char reserved    :3;    
  93.     unsigned char savedPage    :1;    /* 0 == Changes are not permanent.
  94.                      * 1 == Changes are permanent
  95.                      * (stored in non-volatile memory).*/
  96.     unsigned char reserved2[2];
  97.     unsigned char paramListLength;    /* Length of the entire parameter
  98.                      * list. */
  99.     unsigned char vendorUnique    :2;    
  100.     unsigned char reserved3    :4;
  101.     unsigned char flag        :1;    /* Interrupt after linked command. */
  102.     unsigned char link        :1;    /* Another command follows. */
  103. #else /* BYTE_ORDER == LITTLE_ENDIAN */
  104.     unsigned char command;        /* 0x15, for Mode Select */
  105.     unsigned char savedPage    :1;    /* 0 == Changes are not permanent.
  106.                      * 1 == Changes are permanent
  107.                      * (stored in non-volatile memory).*/
  108.     unsigned char reserved    :3;
  109.     unsigned char pageFormat    :1;    /* 1 == SCSI-2;
  110.                      * Must be 1 for Exabyte robot. */
  111.     unsigned char unitNumber    :3;    /* Logical Unit Number to which
  112.                      * to pass the command. */
  113.     unsigned char reserved2[2];
  114.     unsigned char paramListLength;    /* Length of the entire parameter
  115.                      * list. */
  116.     unsigned char link        :1;    /* Another command follows. */
  117.     unsigned char flag        :1;    /* Interrupt after linked command. */
  118.     unsigned char reserved3    :4;
  119.     unsigned char vendorUnique    :2;
  120. #endif
  121. } ModeSelectCommand;
  122.  
  123.  
  124. typedef struct ExbRobotModeSelVendorUnique {
  125. #if BYTE_ORDER == BIG_ENDIAN
  126.     unsigned char reserved    :2;
  127.     unsigned char pageCode    :6;    /* Identifies the vendor unique
  128.                      * parameter list. Must be 0x0. */
  129.     unsigned char paramListLength;    /* Length of the vendor unique
  130.                      * parameter list. It is equal to
  131.                      * 62. */
  132.     unsigned char aInit        :1;    /* 0 == Perform INITIALIZE ELEMENT
  133.                      *      STATUS (0xE7) only when the
  134.                      *      command is issued.
  135.                      * 1 == Perform INITIALIZE ELEMENT
  136.                      *      STATUS after power-up. */
  137.     unsigned char uInit        :1;    /* 0 == Do not perform INIT ELEMENT
  138.                      *      STATUS on a cartridge each time
  139.                      *      it is handled by the CHM.
  140.                      * 1 == Perform INIT ELEMENT STATUS
  141.                      *      each time. */
  142.     unsigned char parity    :1;    /* 0 == Enable SCSI bus parity checking.
  143.                      * 1 == Disable SCSI bus parity checking. */
  144.     unsigned char reserved2    :2;    
  145.     unsigned char notReadyDispCntrl:1;    /* 0 == "Not ready" message
  146.                      *      is flashing.
  147.                      * 1 == Message is steady. */
  148.     unsigned char mesgDispCntrl    :2;    /* Determines how displayMessage
  149.                      * is displayed.
  150.                      * 0 == Flashing 8-char display.
  151.                      * 1 == Steady 8-char display.
  152.                      * 2 == Scrolling display (up to 60 chars). */
  153.     unsigned char reserved3;
  154.     char displayMessage[60];        /* Specifies the ready message that
  155.                      * appears on the operator display when
  156.                      * the robot is ready for operation. */
  157. #else /* BYTE_ORDER == LITTLE_ENDIAN */
  158.     unsigned char pageCode    :6;    /* Identifies the vendor unique
  159.                      * parameter list. Must be 0x0. */
  160.     unsigned char reserved    :2;
  161.  
  162.     unsigned char paramListLength;    /* Length of the vendor unique
  163.                      * parameter list. It is equal to
  164.                      * 62. */
  165.     unsigned char mesgDispCntrl    :2;    /* Determines how displayMessage
  166.                      * is displayed.
  167.                      * 0 == Flashing 8-char display.
  168.                      * 1 == Steady 8-char display.
  169.                      * 2 == Scrolling display (up to 60 chars). */
  170.     unsigned char notReadyDispCntrl    :1;    /* 0 == "Not ready" message
  171.                          *      is flashing.
  172.                          * 1 == Message is steady. */
  173.     unsigned char reserved2    :2;
  174.     unsigned char parity    :1;    /* 0 == Enable SCSI bus parity checking.
  175.                      * 1 == Disable SCSI bus parity checking. */
  176.  
  177.     unsigned char uInit        :1;    /* 0 == Do not perform INIT ELEMENT
  178.                      *      STATUS on a cartridge each time
  179.                      *      it is handled by the CHM.
  180.                      * 1 == Perform INIT ELEMENT STATUS
  181.                      *      each time. */
  182.     unsigned char aInit        :1;    /* 0 == Perform INITIALIZE ELEMENT
  183.                      *      STATUS (0xE7) only when the
  184.                      *      command is issued.
  185.                      * 1 == Perform INITIALIZE ELEMENT
  186.                      *      STATUS after power-up. */
  187.     unsigned char reserved3;
  188.     char displayMessage[60];        /* Specifies the ready message that
  189.                      * appears on the operator display when
  190.                      * the robot is ready for operation. */
  191. #endif
  192. } ExbRobotModeSelVendorUnique;
  193.     
  194.  
  195.  
  196. /* Minor differences between ModeSelect and ModeSense. */
  197.  
  198. typedef struct ExbRobotElemAddrAssign {
  199. #if BYTE_ORDER == BIG_ENDIAN
  200.     unsigned char pageSalvable    :1;    /* Specifies that the EXB-120 is
  201.                      * capable of saving this page
  202.                      * to non-volatile memory. */
  203.     unsigned char reserved    :1;
  204.     unsigned char pageCode    :6;    /* Identifies the Element Address
  205.                      * Assignment parameter list. The
  206.                      * value must be 0x1d. */
  207. #else /* BYTE_ORDER == LITTLE_ENDIAN */
  208.     unsigned char pageCode    :6;    /* Identifies the Element Address
  209.                      * Assignment parameter list. The
  210.                      * value must be 0x1d. */
  211.     unsigned char reserved    :1;
  212.     unsigned char pageSalvable    :1;    /* Specifies that the EXB-120 is
  213.                      * capable of saving this page
  214.                      * to non-volatile memory. */
  215. #endif    
  216.     unsigned char paramListLength;    /* Length of the element address
  217.                      * assignment parameter list. */
  218.     unsigned char transpElemAddr[2];    /* This identifies the address of
  219.                      * the robot arm. */
  220.     unsigned char transpElemCount[2];    /* Number of robot arms. Valid value
  221.                      * for this field is 1. */
  222.     unsigned char firstStorElemAddr[2]; /* Identifies the starting address
  223.                      * of the data cartridge storage
  224.                      * locations. */
  225.     unsigned char storElemCount[2];    /* The number of data cartridge
  226.                      * storage locations within
  227.                      * EXB-120. Max == 116. */
  228.     unsigned char firstEeElemAddr[2];    /* Address of the first Entry Exit Port. */
  229.     unsigned char eeElemCount[2];    /* Number of Entry Exit Ports.
  230.                      * (only valid == 1)*/
  231.     unsigned char firstTapeDriveAddr[2];
  232.                                         /* First address  */
  233.     unsigned char tapeDriveCount[2];    /* Number of tape drives. Ranges from 1-4. */
  234.     unsigned char reserved2[2];        
  235. } ExbRobotElemAddrAssign;
  236.  
  237.  
  238. typedef struct InquiryCommand {
  239. #if BYTE_ORDER == BIG_ENDIAN
  240.     unsigned char command;        /* 0x12 for SCSI Inquiry. */
  241.  
  242.     unsigned char unitNumber    :3;     /* Logical Unit Number to which
  243.                          * to pass the command. */
  244.     unsigned char reserved    :4;     
  245.     unsigned char evpd        :1;     /* Enable Vital Product Data. Selects
  246.                      * The type of inquiry data requested
  247.                      * by the initiator. */
  248.     unsigned char pageCode;        
  249.     unsigned char reserved2;        
  250.     unsigned char allocLength;        /* The number of bytes that the
  251.                      * initiator has allocated for
  252.                      * data returned from the Inquiry
  253.                      * command. */
  254.     unsigned char vendorUnique    :2;     /* Vendor Unique bits. */
  255.     unsigned char reserved3    :4;
  256.     unsigned char flag        :1;     /* Interrupt after linked command. */
  257.     unsigned char link        :1;     /* Another command follows. */
  258. #else /* BYTE_ORDER == LITTLE_ENDIAN */
  259.     unsigned char command;        /* 0x12 for SCSI Inquiry. */
  260.  
  261.     unsigned char evpd        :1;    /* Enable Vital Product Data. Selects
  262.                      * The type of inquiry data requested
  263.                      * by the initiator. */
  264.     unsigned char reserved    :4;
  265.     unsigned char unitNumber    :3;    /* Logical Unit Number to which
  266.                      * to pass the command. */
  267.     unsigned char pageCode;
  268.     unsigned char reserved2;
  269.     unsigned char allocLength;        /* The number of bytes that the
  270.                      * initiator has allocated for data
  271.                      * returned from the Inquiry command.
  272.                      */
  273.     unsigned char link        :1;    /* Another command follows. */
  274.     unsigned char flag        :1;    /* Interrupt after linked command. */
  275.     unsigned char reserved3    :4;
  276.     unsigned char vendorUnique    :2;    /* Vendor Unique bits. */
  277. #endif
  278. } InquiryCommand;
  279.  
  280.  
  281. typedef struct ModeSenseCommand {
  282. #if BYTE_ORDER == BIG_ENDIAN
  283.     unsigned char command;        /* 0x1a for Mode Sense. */
  284.     unsigned char unitNumber    :3;    /* Logical Unit Number to which to
  285.                      * pass the command. */
  286.     unsigned char reserved    :1;
  287.     unsigned char disableBlkDescrptr:1;    /* Not used on Exabyte EXB-120. */
  288.     unsigned char reserved2    :3;
  289.     unsigned char pageControl    :2;    /* Defines the type of parameters
  290.                      * that are to be returned.
  291.                      * 0 == Current values.
  292.                      * 1 == Values which as changeable.
  293.                      * 2 == Default values.
  294.                      * 3 == Saved values. */
  295.     unsigned char pageCode    :6;    /* Specifies which pages are to be
  296.                      * returned.
  297.                      * 0x1d == Element Address Assgnmt Pg.
  298.                      * 0x1e == Transport Geometry Pg.
  299.                      * 0x1f == Device Capabilities Pg.
  300.                      * 0x0  == Vendor Unique Pg.
  301.                      * 0x3f == All pages (in the above order). */
  302.     unsigned char reserved3;
  303.     unsigned char allocLength;        /* Specifies the maximum length
  304.                      * of the parameter list to be
  305.                      * returned. Max == 112 (0x70). */
  306.     unsigned char vendorUnique    :2;    
  307.     unsigned char reserved4    :4;
  308.     unsigned char flag        :1;    /* Interrupt after linked command. */
  309.     unsigned char link        :1;    /* Another command follows. */
  310. #else /* BYTE_ORDER == LITTLE_ENDIAN */
  311.     unsigned char command;        /* 0x1a for Mode Sense. */
  312.     unsigned char reserved2    :3;
  313.     unsigned char disableBlkDescrptr:1;    /* Not used on Exabyte EXB-120. */    
  314.     unsigned char reserved    :1;
  315.     unsigned char unitNumber    :3;    /* Logical Unit Number to which to
  316.                      * pass the command. */
  317.     unsigned char pageCode    :6;    /* Specifies which pages are to be
  318.                      * returned.
  319.                      * 0x1d == Element Address Assgnmt Pg.
  320.                      * 0x1e == Transport Geometry Pg.
  321.                      * 0x1f == Device Capabilities Pg.
  322.                      * 0x0  == Vendor Unique Pg.
  323.                      * 0x3f == All pages (in the above order). */
  324.     unsigned char pageControl    :2;    /* Defines the type of parameters
  325.                      * that are to be returned.
  326.                      * 0 == Current values.
  327.                      * 1 == Values which as changeable.
  328.                      * 2 == Default values.
  329.                      * 3 == Saved values. */
  330.     unsigned char reserved3;
  331.     unsigned char allocLength;        /* Specifies the maximum length
  332.                      * of the parameter list to be
  333.                      * returned. Max == 112 (0x70). */
  334.     unsigned char link        :1;    /* Another command follows. */
  335.     unsigned char flag        :1;    /* Interrupt after linked command. */
  336.     unsigned char reserved4    :4;
  337.     unsigned char vendorUnique    :2;
  338. #endif
  339. } ModeSenseCommand;
  340.  
  341. typedef struct ExbRobotParamListHeader {
  342.     unsigned char senseDataLength;
  343.     unsigned char reserved[3];
  344. } ExbRobotParamListHeader;
  345.  
  346.  
  347. typedef struct ReserveCommand {
  348. #if BYTE_ORDER == BIG_ENDIAN
  349.     unsigned char command;        /* 0x16 for Reserve Command. */
  350.     unsigned char unitNumber    :3;    /* Logical Unit Number to which to
  351.                      * pass the command. */
  352.     unsigned char thirdParty    :1;
  353.     unsigned char thirdPartyDevID:3;
  354.     unsigned char extent    :1;    /* 0 == The device is reserved.
  355.                      * 1 == A series of elements,
  356.                      *      identified by the reserveID
  357.                      *      field and specified by the
  358.                      *      element list descriptor
  359.                      *      are reserved. A minimum of
  360.                      *      six bytes must be sent by
  361.                      *      the initiator. */
  362.     unsigned char reserveID;
  363.     unsigned char elemListLength[2];
  364.     unsigned char vendorUnique    :2;
  365.     unsigned char reserved    :4;
  366.     unsigned char flag        :1;
  367.     unsigned char link        :1;
  368. #else /* BYTE_ORDER == LITTLE_ENDIAN */
  369.     unsigned char command;
  370.     unsigned char extent    :1;    /* 0 == The device as a whole
  371.                      *      is reserved.
  372.                      * 1 == A series of elements,
  373.                      *      identified by the reserveID
  374.                      *      field and specified by the
  375.                      *      element list descriptor
  376.                      *      are reserved. A minimum of
  377.                      *      six bytes must be sent by
  378.                      *      the initiator. */
  379.     unsigned char thirdPartyDevID:3;
  380.     unsigned char thirdParty    :1;
  381.     unsigned char unitNumber    :3;    /* Logical Unit Number to which to
  382.                      * pass the command. */
  383.     unsigned char reserveID;
  384.     unsigned char elemListLength[2];
  385.     unsigned char link        :1;    
  386.     unsigned char flag        :1;
  387.     unsigned char reserved    :4;
  388.     unsigned char vendorUnique    :2;
  389. #endif
  390. } ReserveCommand;
  391.  
  392.  
  393. typedef struct ElemListDescriptor {
  394.     unsigned char reserved[2];
  395.     unsigned char elemCount[2];        /* The number of elements of
  396.                      * a specific type to be reserved. */
  397.     unsigned char elemAddr[2];        /* The address of the element or
  398.                      * starting address of a series
  399.                      * of elements to be reserved. */
  400. } ElemListDescriptor;
  401.     
  402.  
  403. /* end of robot.h */
  404.  
  405.  
  406.  
  407.